#include "__PCH_Arkanoid.h"

#include "InputKeyboard.h"
#include "Core/Core.h"
#include "Input/InputManager.h"
#include "Input/ActionToInput.h"
#include "Player.h"
#include "Sprite.h"

Vect2f	CInputKeyboard::ProcessNewInput	(Vect2f & l_vCurrentPosition, std::string & l_sActionName)
{
	if (m_pActionInput->DoAction("MoveLeft"))
	{
		if ((l_vCurrentPosition.x - 1) < 0)
		{
            l_sActionName = "";

			return Vect2f(0, l_vCurrentPosition.y);
		}
		else
		{
            l_sActionName = "MoveLeft";

			return Vect2f(l_vCurrentPosition.x - 1, l_vCurrentPosition.y);
		}
	}

	if (m_pActionInput->DoAction("MoveRight"))
	{
		if ((l_vCurrentPosition.x + 1) > 1200)
		{
            l_sActionName = "";

			return Vect2f(1200 ,l_vCurrentPosition.y);
		}
		else
		{
            l_sActionName = "MoveRight";

			return Vect2f(l_vCurrentPosition.x + 1, l_vCurrentPosition.y);
		}
	}

    l_sActionName = "";

	return l_vCurrentPosition; 
}